package com.mingdong.first.factory.method;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import com.mingdong.first.factory.pizza.Pizza;

public abstract class OrderPizza {
	
	Pizza pizza;
	String type;
	
	public OrderPizza(){
		do {
			String type = getType();
			Pizza pizza = createPizza(type);
			
			pizza.prepare();
			pizza.cook();
			pizza.cut();
			pizza.box();
			
		} while (true);
	}
	
	public abstract Pizza createPizza(String type);
		
	
	
	public String getType(){
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String type = reader.readLine();
			return type;
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			return "";
		}
		
		
		
	}
	
}
